package org.hardcode.rpc.provider;

import org.hardcode.rpc.common.scanner.reference.RpcReferenceScanner;
import org.hardcode.rpc.common.scanner.server.RpcServerScanner;
import org.hardcode.rpc.provider.common.server.base.BaseServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Map;

public class RpcSingleServer extends BaseServer {

    private final Logger logger = LoggerFactory.getLogger(RpcSingleServer.class);


    public RpcSingleServer(String serverAddress, String scanPackage) {
        super(serverAddress);
        try {
            this.handlerMap = RpcServerScanner.doScannerWithRpcServiceAnnotationFilterAndRegistryService(scanPackage);
        } catch (IOException e) {
            logger.error("RPC server init error ", e);
        }


    }
}
